fix minor js bugs