Added logging in authentication