Moved log to the proper place; renamed "autoClose" method