fix error when no data in model