use bdelete instead of custom function