fixed ghost-piece logic