Fixed crash when clicked on button