while loop for closing multiple tabs