Fix compiler warning: unused variable res