added listener for spacebar