Added error handler for filenames in export code