Fix data structure for countMessages in sqs