implement auto select