minor change in error return logic.