updated code: edit and delete post are functional