controller logic updated