fix js bugs
tweak constants