modified synchronize argument to provide a db instance to the block