Fixed bug in view and updated template