fix bug with doubles