adds code contracts for flash messages