encoder not working