implemented pipe refreshing