use basename is too slow change it use builtin string strip