works in every case except spaces