fix notices and add debug method