moved device creation to button click