JS input stream fix