fixed bad spaces encoding