fix of generating positions