removed dquot to avoid sys command error
moved file transfer function to method and added rescue statement