javascript bugfixes