Catch error if invalid filename given