Added spacebar detection
Fixed spacebar detection