fixed backupType bug, fixed subfolder bug, added sql params and functions