fixed a bug in parse() function