if the getMessages query fails, the method now returns an empty list
instead of null