checkLength added