Finally got data insertion right