Added cleanup on file deletetion.