changed implementation of error checking in indices() method