fixed open file handle issue with len calls
updated length test to be proper test instead of something that needs to be checked manually.