fix int casting