added error check routine