login function & Record function fix