added observer feature for javascript