bug fixing: Could not compare an MDArray with nil
fix nil bug