ensure attributes are there before using them