fix login logic per direction from Vlad