Added loading feature when button is clicked