Added extra check to see if getpwnam(char *username) returned NULL