preventing nullptrs