added logout, redirect if not logged in, error message in register activity