Changed the way getMessages returns. no more if