function getcredentials to work better after first login