fix a bug in oninput to workaround IE9
fix a potential error