flash detection