get rid of 'PHP Notice:  Undefined variable: result'