Fixes delete document