fixed js syntax bug