functional: fix logic in test