put funtion on onclick of button