initial code check for authentication