added check for null pointers in sig and removed debug prints