access object reference outside callback