logout implemented and security splited