Added exception handler for the case when copying a file fails.