Add flash middleware