profile the code to fix IE slow, to be continued