Added new and edit post functionality