updating box position after setting its parent