fix #475, adding preferences to turn off autoclosing