Make available space check optional

fix #3973