fixes slow len calc