order of globals was wrong