added basic log in/out logic