fixing weird numpy operations bug