Added better login page; fixed database connection