bug fix for deletion