adding template and modified controller