fix logic for is() function