Fixed bugs - getMessages
little fixed