added system calls to remove old files and sqldb