modified debug.hm to fit environment