moved selectIfNeeded to public so folderinfooperation can use it.