extend example for use then and deferred
fixed isCertFilesExists and create fn isBool