Fixed error refresh bug