Passed encoding in the wrong place