Added lock on selection buffer