fix overlay hide logic