fix coverity detected defects