fix piece variable