Fixed depracated use of variables