fixing logout view and using g object in layout