protecting callback scope