Due to some problems with my host, I've had to pull a function from set_state.php