fixed bug with polygon orientation