I just found out that if I turn off the background script the turn will end perfectly fine.