Ok, thanks for comment. I will rewrite it to use encode instead,