Add controller logic