isfile() safety check

Makes sure that the file exists before it starts to do anything