fixed issue #21 + fixed memory leak on ie