Revert "Boolean logic error"

This reverts commit 16e043cf6cbb6489a5dff630d7c6f63b2fc3f0bd.