accounting for element id being "null"