Fixed a bug in the retrieving of the correct SESs