fix 'else' branch and doc update