Changed implementation of delete