adds beginning of refreshPost function