Refactor transaction

refactored new post save to add db transactions