fix long vs int issue