correctly deleting files