place null testing before first use