removing register events adding codec to state