Hopefully handle page visibility things more gracefully