fixed sorting bug in web.py