Adding sync, solving mutex problems on the database.
Merge remote-tracking branch 'origin/master'