added a controller for dealing with messages