edit 'editPost' function in post model