Updated set_state.php to work with PHP 5.3