Checking for onpagehide is probably enough