added more helpful error messages for global var creation