added database and error handling in registering form though not done yet