add code to index and add controller