Added a proper much improved validation for user

Please test and see whether the validation works. It should work as i
have tested it already.