add null argument checks.