adds selector logging for invalid elements and adds tests for thrown errors