delete file logic