Fixing up the looper to work with auto sign in and tidied up the logging