Added login page and tweaked some functions, also: error in login function