small fixes for the data insertion