updated to perform a safe pull