Added global pointers to fix fatal error