improves ajax utility function for shiny