adapt error to both versions