Further prevention of illegalstateexception
Prevent file nullpointerexception in deletion