fix multiple declare on the same box
fix the cases if popbox excees window horizontally
remove selector usage