bug fix in cpp compiling