handle error when creating index