checks if callback is defined