Fixed an issue with encoding in a hacky way