Fix issue of improper element.remove, moving it to setTimeOut

Would like to fix #150.