minor js hacks