fix encoding null issue