Add extra check to opened file opointer.