Added function 'checkDir()' which makes sure the entered destination folders are valid.