delete functionality for controller