javascript bugfix