protecting delete post function