added a function to modify variable selection working logic