add better support for filenames in register statement