added edit controller and functionality