Changed fail function name to error