add flashed-messages handling in templates