fixed s_rules's potential overrun