Fixed missing var and compile error