fixed parsing, added length