fixed some bugs in js 12/25 14:40