Implemented the delete function for posts