fix: fixed if check in anonymous calls