need to use .get('messages') to not get a keyerror