prepare login procedure