Added code to be able to edit existing posts