Fixing pagelayout, checking if variable exists