#172 fixed bug for wrong ancor position when switching layouts