fixing cpp error