discard bug fix