fix sql query for register#2