fixing problem in selection