added auto-open feature