Fix database by adding checks for duplicate users