Fixes #1 & onbeforeunload dialog after logout fixed