Fixes file overwrite regression

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>