logic problem after change