added sanity check to scripted behavior