fixed some GD issues