fixed bug in stackpoly