solve a bug: logout when writing files will result in 'footer' disappear