quick fix for instantaneous flow
some error handling for files