fixed annoying undefined length error
Merge pull request #256 from bobrik/undefined-length-fix

Fixed annoying undefined length error