added check length