Output is correct but validation does not pass . Whats wrong here?