update optional for coverity scan
fixes for coverity scan