Consider using the forType syntax demonstrated in the documentation. Either instead of this, or as an additional alternative test.