Fixing error where X button caused a too many positional arguments error.