more robust js, check the right overlay