Fix for uwsgi shutdown