fix for reszing case
code refactor, fix for original position