Added gracefully shutdown function to selenium server