Fix bug in apps.py