fixed bug with deletion