Added logout method and also fixed views rendering context