add onunload event to close user