fixed bug in getSelected