fix: using indexOf() for evaluation of empty element