adding an isset() to prevent notices