fix nil issue