fix bugs with spaces