we can check code before logout (js alert), closes #10