Adding support for soft deletes

With thanks to ramesh-tr