only set callback if provided, fixes #2