added support for editing and adding posts