removing directory with space at the end