test logic fixed