Hotfix rearranged code