making function global