fix nil exception