Add device listener. Not working quite properly yet.