problem to insert filter rule (firewall) by api

By entering filter rule using the api, my connection gets stuck and the browser crashes.

I had a similar problem where connections were arrested in previous versions of RouterOS, but this was resolved in version 5.

I’m just having trouble when I try to put rules on the firewall.

I’m using API with PHP language.

what might be causing this problem?

My code:

public function insereFilterL7($filter, $options = array()){
	$arrayFilter = $filter->getAsArray();

	foreach($arrayFilter as $key => $valor) {
		if($valor != ''){
			$options[$filter->convertNome($key)] = $valor;
		}
	}
	$this->api->comm('/ip/firewall/filter/add', $options);
	
	$this->api->disconnect();
}

Where ‘$this->api’ is an object by routeros_api class.

The rule is puted but the connection is crashes