Added auto-open functionality