update encoders and fix some errors