autoclosing bug fix