changed the event to button click

Just added a button in page and called that function directly from button