12.21 update the implemetation of log_out