added debug switch to rule