Fixed bug when name had spaces