fix rules is not cleared before reloading bug
write protection