ried to fix pointer error