fix for older versions of flask