change logic for determining screen visible frame