added code that prints out error message when found trivial null vector