improve login and regist model