edited to work with wired connection