fix a timing issue after open, and improve open logic