fixes wrongly named variable that was resulting in undefined message