Retry-after-login feature added, cope from the book, nice one :)