support older numpy versions