add edit function to post