Moved Login Log Code to a more appropriate position