Fix Bug Java script