fix #6, and performance optimize for ie6/7