js/ajax bug fixes in footer