Javascript bugfix