Changed capability check to use exists.