fix js runtime error