Modified a little bit the logic and some part of the code because I firstly I considered to use directly object instead of the right TextMessage...