implement login procedure