small modifications for javascript