fixing undefined stat