This should be set in the close function not here