Writing user into database