fix encoding

also fixes #2