use getMessages instead of all to preserve array keys