Cast to string
Writing file upon crash