Add checks for the selector to be in range