fixed direct login functionality