rewrite: add flashes to templates