bug fix on test flag