added isset check

put an isset check to resolve Undefined index at start of program