added user validation functionality.