Create variable isError and use it here and below