Updated deletion functionality.