Fixed occaisional crash when changing files