fixed some global issues