fixed bug in arg array length check