Add guard condition
Add guard condition whether file is exist or not
Refactor