fix compatibility issues for popup layout