fixed some build stability issues