Utilise map onload event

Alos only run a search when necessary