fixed error function return vals