updated controllers to fix delete function