use typeof to check for boolean in _isBoolean() function