fix ie compatibility, and code format