set resource to null when close an active chat.