fix logic fail