fix using an uninitialised value