replace spaces with underscore in the file name and selector

fix #747