Fix logic progrm