or rather: move renderMessages here, and then move the rendering flag here :)