fix bug for removing files