fix flask context problems from abc