Add the fucntion to delete window