set self.parser null instead of calling undefined function end. Fixes #7