added check for callback existance before invocation