more java script fixes #4635