be careful to lock cred before using it