implement selectVersion function