fixing bugs with clearing errors, adding method for generating JS to reload a data table