fix for login function [WIP]