Fix problem encoding data