resolved the resLength issue