Added session and security stuff