added functions to enable dynamic updating from javascript