error checking of cpp fixed