Fixed issue where bounding box appear/disappear at the wrong timings