adding an isset to get rid of the undefined index warning