Trying to fix runtime error in Parser class