non-object warning fix