almost working login feature