error in getSQL on invalid rules