add loc sync feature and fix bugs