added logout and some fixes, no code changes until unit tests are created\!