stash
the code was correct before, device is already defined