fixed a bug in the parse() method