add some log messagge, log to file, fix avatar folder problem