improved uwsgi state check