Little fix on check_credential