Adding different error handling