fix login detection