fix js bugs