implemented debug