set withCredential to be true