fix logic.