Added source code for database sync