fixing bug related to cs-res