What $CONFIG is intended to? It looks like if( isset( $CONFIG ) && is_array( $CONFIG )) will never be true after this unset