Change $str to $data