cleanup flask