fixed a bug with doubles