LPS-48279 fix logic error (confirmed with @marcellustavares)