chaiwat update function logout