fix bug in guard-handler.insert