use openstruct instead of hash and fix no data error