add log function. do some ui changing.