change logic in posts controller for layouts