Checking of error was generated before returning error string
return nil explicitly  for clarity