Your sentence is not wrong. I edited it because whether is more appropriate than if is in cases of two possible alternatives. Sometimes if and whether are interchangeable, as in the following two examples.
He is not sure if he should buy the new computer.
He is not sure whether (or not) he should buy the new computer.