fix login procedure