remove folder if is necessary