Fix problem in javascript