Loginfunction fixxed