Fixing bug where duplicate user entries would be created