fixed use of len