Replace is_string with instanceof