Pass the selector to the main function