trying to pass right value to C function