fix logout on ajax request