fixed showing flag in unnecessary cells