Correcting logic issue in naming