changed test logic as suggested