Fix INSERT  query saving to SD
Code Cleaning