added a controll for file existens

Does not work att the moment.