Fix preview box not hiding