updated login functions