fixed a bug when updating form position