Updated checks for username and made a test case