removed NOTICE warinigs with Undefined variable and Undefined index