added null check file