Updated logout procedure