Added debugging code for authentication