bugfix in js