updated posts controller