Add function to set credential