Fix position undefined issue when using  as target