Fixed templating code, added logout button