moved last post updating to a single function (closes #1)