fix some database issue. add user reg and sign in feature.