Pass device in onEvent