Implemented debug mode