Added login and security functionality