Coverity issue fix for return type check implemented