Updated to improve synchronization between modules