added username and email validation function