added JS functions to methods