Updated undefined index: #primary error
Fixed #129