buffer selection related bug fixed