fix none caption error & add debug mode in main