edited from school, comment out autoclose