complete register,but there are bugs