Fixed missing use of variable id