minor bugfix when using python 3

Flask will break when SECRET_KEY is set. And I found a solution for this