xfile fix
added exception check