fix crash caused by testing code in commit 796e0a0