Fix small bug
Add file check