fix login loop issue