fix variable scope in exception message