tried to do a bit of the autoclose but got stuck