added JS function