modified app/controllers, fix display and redirect for invalid id