fixed test flag check