added editing functionality for posts