add FILE argument to debug functions