added code for javascript