* stabalized insert_data() function