Add simple check to fix bug.