Check if file exists only if input changed