Added Login System, fix some bugs