fix casting