Changed Register system to use a database