fix meta to header and add input data check