Add ability to run JS code from states