adds functionality to complete selection on space key