Fixing bug in selection model