add exception handling to add_data.php