Fix for database replication