fix error handling in do_actions.php