revert 5c3548994e3f01ff9ae99bb7fced59ee35765733 and instead cast to long