added check if file exits