add check for after/before or state pseudos