fixing the bug in the pages controller trying to get a layout that doesn't exist