some js bugfixes