trim selector, validate and error to user if invalid selector