split string and popped extension correctly