Fix using uninitialised variable