use cstr instead of str in check_if_latest