fixing glbobal variables