Any reason why this is printing to stdout on error?