Modified webapt/core.py