fixes bug in map length