edit controller logic