fixing bugs related to login procedures