fix crash and use block for data validation