fixing encoding errors