Moved delete function to manage view