added a bit of error reporting while parsing