Fixed aggregate errors and handling keycloak session expiration

Fixed aggregate errors and handling keycloak session expiration