Adding test to handle error