Security issue to prevent file overwriting