File validation

Now checking if input actually exists, and if the name is valid