made posts controller more efficient