adding function to bulk insert