changed handling of callback