updated onspaceclicked