added closefunction only gives small insignificant error while closing the window