fix selector bug and add tests