check if the dom elements inside of common.js exist before trying to access them