bug fix, forgot to wrap instanceof in parentheses