Fix crash when doing head snapshot

add lost patch