Fixed sync issue with commit() calls