Slight changes to login functions