replace methode getMessages by getMessageBag. getMessages is private
Fix undefined function