Added check for file exsistance