conditional modal fix