encoding was always still true fixed it with a simple null check (it is nasty but should work)