Added workaround to the print api for the ui window not closing.