added JS signals to have it working with Shiny