fixed bug in setting positions