isValidUsername function added.