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