fix bug elementPosition undefined