move error message to return value