Logger not being initiated correctly, bad variable