Changing globals seem to cause problems