got flash detection working