fixed a bug in the selection function