1. add global debugprint function to log debugging info to file

2. bug fixed on candidate showing