fixed reset password function