fix bug returning undefined on button press v1.02