fix a bug with open