Add flags detection in the interrupt fct