master controller logic updated