Properly check for changes to database