handling error type