Changed the code for name validation