implemented login threading