move check into existing loop so it can catch compound operations too