working login controller