add selection checking