fix blog controller to stop repeating code