added a debug flag