debugging login function