Handle spaces correctly