adding logout button and fixing UNION ALL bug