added function addarray and closeTabAndRememberUrl