Updated conditions logic.