respect boolean short-circuit when handling side-effects