fix bug detect fct