fix overlay undefined issue