removing the unwanted spaces