fix warning (undefined behavior)