fixes overflow issue #50