added fix for random spaces