added debug toggle