Corrected log in functionality