revert cast as breaking on 32 bit