Fixed some bug with LoginWindow memory leak,
Code formatting and improving procedures have been made.