fixed bug in cpp files