added error branch