check the encode