Added option.replace to get error function