fixed wrong logic in tests