fixed bug in midi parser code