added debug logging flag