registration partially working with database