fixed simple bug onunload events introduced in 3.4.4 version.
changed logic for async argument to xhr function
replaced deprecated files import