check_replace fixed