proper onlogin hook