data length fix and check