fixes an error that occured after editing a post