made loginfunction