added source output synchronization code