Close function added