Fix bug in ajax.py