fixing null pointer in anderson implementation