fixed issue when refreshing page