some modification in javascript