fix the compile error and add new logout callback function