Revert "Revert "Add global variable checks""

This reverts commit 0158b95bf7c026278a8f8648f527bcb5db20aacd.
Revert "add commits"

This reverts commit cd3c24c907aad356dc6425f5436010bc0827b577.