fixed some encoder stuffs