added first exception handling