Added some controller logic