properly remove file