Modified js for better ajax serving.