fix bit bug (must support 64-bits)