fix unitialized javascript