helps if you close functions properly