adding workaround for older numpy versions