fix casting
fix protocol method emission