Updated controller and extended the message class