added checks and file