fixed test logic