fixed .close scope for both functions