fix bugs caused by jQuery/jqLite wrapped element