Added error cases