Sign singularity and flares in solar active region NOAA 11158