added more controller logic
added more controller logic