fixed foreach warning in jms serializer