Added delete function to controller