fix detect method, when attribute's value is falsy