Use fileUtils.cp_r instaed of directory method