Loop synchronization issue fixed