added a flash example and error message display