encoder flickering fix and improvements